<script setup lang="ts">
import { onMounted, } from "vue";
import { request } from "../utils/axios/request";
import { useUserStore } from "../utils/store/store";
import { user, userType } from "../utils/ts/user";
import ConsoleHead from "../components/Console/Header/ConsoleHead.vue";

const store = useUserStore();

// const app = [document.querySelector("body"), document.querySelector("#app")];

onMounted(() => {
  request(user).then((res) => {
    store.setUser(res.data as userType);
  });

  // app.forEach((val) => val?.setAttribute("style", "min-width: 1400px"));
});

// onUnmounted(() => {
//   app.forEach((val) => val?.removeAttribute("style"));
// });
</script>
<template>
  <ConsoleHead />
  <router-view />
</template>
<style lang="scss" scoped></style>
